package com.gdth.broadcastreceiver;

import org.greenrobot.eventbus.EventBus;

import com.gdth.bank.event.CjkhjlListEvent;
import com.gdth.service.BankService;
import com.gdth.service.HeartService;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

/**
 * 系统广播
 * @author arvin
 *
 */
public class OlympicsReceiver extends BroadcastReceiver {   
      
    static final String ACTION = "android.intent.action.BOOT_COMPLETED"; 
    public void onReceive(Context context, Intent intent) {
    	 
        if (intent.getAction().equals(ACTION)) {
//        	启动服务
        	context.startService(new Intent(context, BankService.class));
        	context.startService(new Intent(context, HeartService.class));
        	Toast.makeText(context.getApplicationContext(), "service has started!", Toast.LENGTH_LONG).show();   
//          这边可以添加开机自动启动的应用程序代码
        	
        }
      
        
//        boolean isNet = false;
//        
//        if (!isNet){
//        	Toast.makeText(context.getApplicationContext(), "网络不可用", Toast.LENGTH_LONG).show();
//        }
    }   

    
}
